package com.ycode.bang.anbang.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ycode.bang.anbang.R;
import com.ycode.bang.anbang.customview.MyGridView;
import com.ycode.bang.anbang.model.Order;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by maosongsong on 2016/4/6.
 * 维修记录的适配器
 */
public class RecordAdapter extends RecyclerView.Adapter<RecordAdapter.ViewHolder> {
    public Context mContext;
    public List<Order> mBean;

    public RecordAdapter(Context mContext, List<Order> mBean) {
        this.mContext = mContext;
        this.mBean = mBean;
    }


    @Override
    public RecordAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_record, parent, false);

        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        ImageAdapter mAdapter = null;
        List<String> mList = new ArrayList<>();
        mAdapter = new ImageAdapter(mContext, mList);
        holder.gridview2.setAdapter(mAdapter);
        /*Order bill = mBean.get(position);
        holder.tvt_event_title.setText(bill.name);
        holder.tvt_importance.setText(bill.time);
        holder.tvt_time.setText(bill.amount);
        holder.tvt_address.setText(bill.amount);
        holder.tvt_name_phone.setText(bill.amount);*/
    }

    @Override
    public int getItemCount() {
//        return mBean.size();
        return 3;
    }

    public static class ViewHolder extends RecyclerView.ViewHolder {
        public TextView tv_jilu;
        public TextView tv_jilushijian;
        public MyGridView gridview2;

        public ViewHolder(View v) {
            super(v);
            tv_jilu = (TextView) v.findViewById(R.id.tv_jilu);
            tv_jilushijian = (TextView) v.findViewById(R.id.tv_jilushijian);
            gridview2 = (MyGridView) v.findViewById(R.id.gridview2);
        }
    }
}

